package com.douqu.game.mergeManager.mergeUtils;

import javax.swing.*;
import javax.swing.table.TableCellRenderer;
import java.awt.*;

/**
 * @author: Gavin.
 * Description:
 * Date: 2018/6/8 0008 下午 3:50
 * Huan Yu Copyright (c) 2017 All Rights Reserved.
 */
public class MyRenderer implements TableCellRenderer {
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
                                                   boolean hasFocus, int row, int column) {
        UpperCaseField editor = new UpperCaseField(10);
        if (value != null)
            editor.setText(value.toString());
        editor.setBackground((row % 2 == 0) ? Color.white : Color.cyan);
        return editor;
    }
}
